<?php

/**
 * Created by PhpStorm.
 * User: bill-h
 * Date: 2021/10/8
 * Time: 17:27
 * Email: 391878487@qq.com
 */
namespace exceptions;


use Throwable;

/**
 * Class AuthException
 * @package extend\exceptions
 */
class AuthException extends \RuntimeException
{
    public function __construct($message = "", $code = 0, Throwable $previous = null)
    {
        if (is_array($message)) {
            $errInfo = $message;
            $message = $errInfo[1] ?? '未知错误';
            if ($code === 0) {
                $code = $errInfo[0] ?? 400;
            }
        }

        parent::__construct($message, $code, $previous);
    }
}